//
//  RespObject.m
//  TaoLeSong
//
//  Created by EmberWei on 2017/07/03.
//  Copyright © 2017年 LimeKing. All rights reserved.
//

#import "RespObject.h"
#import "Marcro.h"

@implementation RespObject

+ (void)analyseWithData:(id)data complete:(void (^)(__kindof RespObject *result, NSError *errMor))complete {
    
    __kindof RespObject *result = [JsonAdapter objectFromJsonData:data objectClass:[self class]];
    if (!result) {
        BLOCK_EXEC(complete, nil, [NSError errorWithDomain:@"服务器返回非JSON格式字符" code:400 userInfo:nil]);
        return;
    }

    BLOCK_EXEC(complete, result, nil);
}

@end
